﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSP.Model.CSP;
using CSP.Model.CSPBBS;
using CSP.Model.CSPEnum;
using CSP.Bll.DTO.UserInfo;

namespace CSP.Bll.IObjectBlls
{
    public interface IUserInfoBll : IDisposable
    {
        /// <summary>
        /// 普通登陆
        /// </summary>
        /// <param name="userNameOrUid"></param>
        /// <param name="pwd"></param>
        /// <param name="loginType"></param>
        /// <returns></returns>
        Member GetUser(string userName, string pwd);

        /// <summary>
        /// 单点登陆
        /// </summary>
        /// <param name="userNameOrUid"></param>
        /// <param name="pwd"></param>
        /// <param name="loginType"></param>
        /// <returns></returns>
        Member GetUser(int uid, string pwd);

        Member GetUser(string userName, bool isLoadUserProfile = false);

        Member GetUser(int uid, bool isLoadUserProfile = false);

        /// <summary>
        /// 根据用户名获取用户基本信息
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        UserBasic GetUserBasicByUser(string userName);

        /// <summary>
        /// 判断用户名是否存在
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool IsExsitByUserName(string userName);

        /// <summary>
        /// 第三方登陆
        /// </summary>
        /// <param name="userLoginType"></param>
        /// <param name="otherIdentity"></param>
        /// <param name="accessToken">令牌可为空</param>
        /// <returns></returns>
        Member OtherLogin(UserLoginType userLoginType, string otherIdentity, string accessToken = "");

        /// <summary>
        /// 根据用户名和邮件第三方注册
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="email"></param>
        /// <param name="userLoginType"></param>
        /// <returns></returns>
        Member OtherRegister(OtherRegisterDTO otherRegisterDTO);

        void AddUserBasic(UserBasic obj);

        void AddUserInfo(Member member);

        void Update(UserBasic obj);

        void DeleteById(int id);

    }
}
